package com.ruoyi.chat.domain;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * 聊天记录实体类，对应 chat_records 表
 *
 * @author [whk]
 */
public class ChatRecords {
    /**
     * 主键，唯一标识每条聊天记录
     */
    private Long id;

    /**
     * 会话ID，关联到chat_conversation表
     */
    private Long conversationId;

    /**
     * 用户的提问内容，支持存储较长的文本
     */
    private String userQuestion;

    /**
     * AI 的回答内容，支持存储较长的文本
     */
    private String aiResponse;

    /**
     * 聊天记录的时间戳，记录对话发生的具体时间
     */
    private Date timestamp;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 是否删除(0-未删除,1-已删除)
     */
    private Integer isDeleted;

    public ChatRecords() {
    }

    public ChatRecords(Long id, Long conversationId, String userQuestion, String aiResponse, Date timestamp, Date createTime, Integer isDeleted) {
        this.id = id;
        this.conversationId = conversationId;
        this.userQuestion = userQuestion;
        this.aiResponse = aiResponse;
        this.timestamp = timestamp;
        this.createTime = createTime;
        this.isDeleted = isDeleted;
    }

    /**
     * 获取
     *
     * @return id
     */
    public Long getId() {
        return id;
    }

    /**
     * 设置
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取会话ID
     *
     * @return conversationId
     */
    public Long getConversationId() {
        return conversationId;
    }

    /**
     * 设置会话ID
     */
    public void setConversationId(Long conversationId) {
        this.conversationId = conversationId;
    }

    /**
     * 获取
     *
     * @return userQuestion
     */
    public String getUserQuestion() {
        return userQuestion;
    }

    /**
     * 设置
     */
    public void setUserQuestion(String userQuestion) {
        this.userQuestion = userQuestion;
    }

    /**
     * 获取
     *
     * @return aiResponse
     */
    public String getAiResponse() {
        return aiResponse;
    }

    /**
     * 设置
     */
    public void setAiResponse(String aiResponse) {
        this.aiResponse = aiResponse;
    }

    /**
     * 获取
     *
     * @return timestamp
     */
    public Date getTimestamp() {
        return timestamp;
    }

    /**
     * 设置
     */
    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }

    /**
     * 获取创建时间
     *
     * @return createTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取是否删除
     *
     * @return isDeleted
     */
    public Integer getIsDeleted() {
        return isDeleted;
    }

    /**
     * 设置是否删除
     */
    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    public String toString() {
        return "ChatRecords{" +
                "id=" + id +
                ", conversationId=" + conversationId +
                ", userQuestion='" + userQuestion + '\'' +
                ", aiResponse='" + aiResponse + '\'' +
                ", timestamp=" + timestamp +
                ", createTime=" + createTime +
                ", isDeleted=" + isDeleted +
                '}';
    }
}
